<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    用户名<input type="text" id='username'><br/>
    电话<input type="text" id='telephone'><br/>
    密码<input type="text" id='password'><br/>
    <button id='btn'>注册</button>
</body>
<script src="jquery-1.11.3.js"></script>
<script>
$('#btn').click(function(){
    $.ajax({
        type:'get',
        url:'http://localhost/1907/register.php',
        data:{username:$("#username").val(),telephone:$("#telephone").val(),
        password:$("#password").val()},
        dataType:'json',
        success:function(data){
            console.log(data)
            
            if(data.code>0){
                alert(data.msg)
                location.href="denglu.html"
            }else{
                alert(data.msg)
            }
            
        }
        

    })


})





</script>
</html>